<!DOCTYPE html>
<html>
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
        <title>$.fn.scrollTop</title>
        <script>
            window.$$path = location.protocol + "//" + location.host;
            document.write('<script src="' + $$path + '/mass_merge.js"><\/script>');
            document.write('<script src="' + $$path + '/doc/scripts/common.js"><\/script>');
        </script>
    </head>
    
    <body>
        <article>
            <style type="text/css">
                div.demo {
                    background:#CCCCCC none repeat scroll 0 0;
                    border:3px solid #666666;
                    margin:5px;
                    padding:5px;
                    position:relative;
                    width:200px;
                    height:100px;
                    overflow:auto;
                }
                .demo p { margin:10px;padding:5px;border:2px solid #666;width:1000px;height:1000px; }
            </style>
            <h3>$.fn.scrollTop( [val] )</h3>
            <p>
                <span class="stress">描述：</span>
            </p>
            <p>取得或设置匹配节点的scrollTop。</p>
            <p>此方法是属性于get one set all操作，根据传入参数决定其是读操作还是写操作。</p>
            <p>如果没有参数，则读取第一个元素的scrollTop，并返回。</p>
            <p>如果存在参数，通过它设置所有元素的scrollTop,并返回原实例。</p>
            <fieldset>
                <legend>例子</legend>
                <div class="demo">
                    <h1>lalala</h1>
                    <p>Hello</p>
                </div>
                <pre class="brush:xml;gutter:false;toolbar:false">

                &lt;style&gt;
                div.demo {
                     background:#CCCCCC none repeat scroll 0 0;
                     border:3px solid #666666;
                     margin:5px;
                     padding:5px;
                     position:relative;
                     width:200px;
                     height:100px;
                     overflow:auto;
                }
                .demo p { margin:10px;padding:5px;border:2px solid #666;width:1000px;height:1000px; }
                &lt;/style&gt;

                &lt;div class="demo"&gt;&lt;h1&gt;lalala&lt;/h1&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;

    
</pre>
                <pre class="brush:javascript;gutter:false;toolbar:false">
$.require("ready,node,css", function() {
    $("div.demo").scrollTop(300)
})
</pre>
                <button class="doc_btn" type="button">点我，执行代码</button>
            </fieldset>
        </article>
    </body>

</html>